package Waiting;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class StaticValue {
    //背景
    public static BufferedImage bg1=null;
    public static BufferedImage bg2=null;
    public static BufferedImage bg3=null;

    //冰人向左跳跃
    public static BufferedImage blue_jump_L=null;
    //冰人向右跳跃
    public static BufferedImage blue_jump_R=null;
    //冰人向左站立
    public static BufferedImage blue_stand_L=null;
    //冰人向右站立
    public static BufferedImage blue_stand_R=null;
    //冰元素门
    public static BufferedImage blue_door=null;
    //钻石
    public static BufferedImage gem=null;
    //加载蓝水
    public static BufferedImage lanshui=null;
    //加载地板
    public static BufferedImage floor = null;

    //障碍物
    public static List<BufferedImage> obstacle = new ArrayList<>();//障碍物很多，创建一个列表
    //冰人向左跑：两张图片
    public static List<BufferedImage> blue_run_L = new ArrayList<>();
    //冰人向右跑
    public static List<BufferedImage> blue_run_R = new ArrayList<>();
    //死水 两张图片：动起来
    public static List<BufferedImage> sishui = new ArrayList<>();



    //路径的前缀，方便后续调用 绝对路径
    public static String path = System.getProperty("user.dir")+"/src/imagesss/";

    //初始化方法
    public static void init(){
        //加载背景图片
        try {
            bg1 = ImageIO.read(new File(path+"begin.jpg")); //调用path方法，拼接路径
            bg2 = ImageIO.read(new File(path+"begin2.jpg"));//结束场景
            bg3 = ImageIO.read(new File(path+"onebg.jpg")); //第一关场景
            //加载冰人向左站立
            blue_stand_L = ImageIO.read(new File(path+"blue_stand_l.jpg"));
            //加载钻石
            gem = ImageIO.read(new File(path+"gem.jpg"));

            //加载蓝水（先用红色的图片）
            lanshui = ImageIO.read(new File(path+"red_river.png"));

        } catch (IOException e) { //捕获异常
            e.printStackTrace();
        }

        //加载冰人向右跑
        for(int i=1;i<=2;i++){
            try {
                blue_run_L.add(ImageIO.read(new File(path+"blue_run_r"+i+"png")));
            } catch (IOException e) { //捕获异常
                e.printStackTrace();
            }
        }
        //加载障碍物
        try {
            obstacle.add(ImageIO.read(new File(path+"boxx.png")));
        } catch (IOException e) { //捕获异常
            e.printStackTrace();
        }

    }

}

